<?php

use yii\db\Schema;
use yii\db\Migration;

class m160316_112518_update_solution_pmp_function extends Migration
{
    public function up()
    {
        $this->addColumn('{{%solution}}', 'is_pmp', 'tinyint(1) not null default 0 comment "0 rtb, 1 pmp" after budget');
        $this->addColumn('{{%solution}}', 'pmp_guid', 'int(10) not null default 0 comment "pmp guid" after is_pmp');
        $this->addColumn('{{%solution}}', 'pmp_price', "decimal(10,2) not null default 0 comment 'pmp 交易价格，按 cpm 计算' after is_pmp");
    }

    public function down()
    {
        $this->dropColumn('{{%solution}}', 'is_pmp');
        $this->dropColumn('{{%solution}}', 'pmp_guid');
        return $this->dropColumn('{{%solution}}', 'pmp_price');
    }

    /*
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
    }

    public function safeDown()
    {
    }
    */
}
